package cz.muni.fi.PA165.musiclibraryweb;

import cz.muni.fi.PA165.musiclibraryweb.album.AlbumPage;
import cz.muni.fi.PA165.musiclibraryweb.author.AuthorPage;
import cz.muni.fi.PA165.musiclibraryweb.genre.GenrePage;
import cz.muni.fi.PA165.musiclibraryweb.song.SongPage;
import cz.muni.fi.PA165.musiclibraryweb.signin.SignInSession;
import cz.muni.fi.PA165.musiclibraryweb.signin.SignOut;
import java.io.Serializable;
import org.apache.wicket.Session;
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;

@AuthorizeInstantiation({"USER", "ADMIN"})
public class HomePage extends WebPage implements Serializable, AuthenticatedWebPage {

    private static final long serialVersionUID = 1L;

    public HomePage(final PageParameters parameters) {
        super(parameters);
        
        SignInSession session = ((SignInSession)Session.get());

        add(new Label("currentUser",session.getUser()));
        add(new BookmarkablePageLink("logout", SignOut.class));
              
        add(new Label("title", new StringResourceModel("title", this, null)));
        add(new BookmarkablePageLink("page1", SongPage.class));
        add(new BookmarkablePageLink("page2", GenrePage.class));
        add(new BookmarkablePageLink("page3", AlbumPage.class));
        add(new BookmarkablePageLink("page4", AuthorPage.class));

    }
    

}
